package com.ss.android.newmedia.feedback;

import android.content.Context;
import android.view.View;
import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.browser.R;
import com.ss.android.common.util.NetworkUtils;
import com.ss.android.j.b;

final class p implements View.OnClickListener {
    private final SubmitFeedbackActivity a;

    p(SubmitFeedbackActivity arg1) {
        this.a = arg1;

    }

    public final void onClick(View arg8) {
        int v5 = R.drawable.close_popup_textpage;
        SubmitFeedbackActivity v0 = this.a;
        if(!v0.k) {
            if(!NetworkUtils.isNetworkAvailable(((Context)v0))) {
                UIUtils.showImageToast(((Context)v0), v5, R.string.ss_error_no_connections);
            }
            else {
                String v1 = v0.a.getText().toString();
                String v2 = v0.b.getText().toString();
                if(!android.support.design.a.isTextEmpty(v1) && v1.length() >= 2) {
                    v0.k = true;
                    if(v0.c == null) {
                        v0.c = b.createProgressDialog(((Context)v0));
                        v0.c.setTitle(com.ss.android.article.browser.R.string.tip);
                        v0.c.setCancelable(false);
                        v0.c.setMessage(v0.getString(com.ss.android.article.browser.R.string.a0r));
                        v0.c.setButton(-2, v0.getString(com.ss.android.article.browser.R.string.label_cancel), new t(v0));
                    }

                    v0.c.show();
                    if(!android.support.design.a.isTextEmpty(v0.e) && !(v0.h + "/" + v0.i).equals(v0.e)) {
                        new u(v0, v1, v2).start();
                        return;
                    }

                    m v3 = new m();
                    v3.b = v0.d;
                    v3.a = v1;
                    v3.c = v2;
                    v3.d = v0.e;
                    v0.a(v3);
                    return;
                }

                UIUtils.showImageToast(((Context)v0), v5, R.string.info_too_less);
                v0.a.requestFocus();
            }
        }
    }
}

